/**
 * 站点信息模型 
 * 
*/
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("website", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            defaultValue: Sequelize.UUIDV4,
            get() { // UUID的自动递增
                return () => {
                    return this.getDataValue('id');
                };
            }
        },
        avatar: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            comment: '站点主头像',
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            comment: '站点名称',
        },
        slogan: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            comment: '站点格言',
        },
        domain: {
            type: Sequelize.STRING,
            comment: '站点主页',
        },
        notice: {
            type: Sequelize.STRING,
            comment: '站点通知',
        },
        desc: {
            type: Sequelize.STRING,
            comment: '站点描述',
        },
        wallpaper: {
            type: Sequelize.STRING,
            defaultValue: '',
            comment: '站点大背景图',
        },
        isNewYear:{
            type: Sequelize.BOOLEAN,
            comment: '是否新年',
            defaultValue: false,
            field:'is_new_year'
        },
        globalStyle: {
            type: Sequelize.STRING,
            comment: '站点全局样式：公祭日置灰等',
            field:'global_style'
        },
    })
}